#include "MyMultiLineEdit.h"
void MyMultiLineEdit::setText ( const QString & text )
{
	tmpStr=text;
	tmpStr.replace(QRegExp("\\["),phoneticHead);
	//std::cout<<tmpStr<<std::endl;
	tmpStr.replace(QRegExp("]"),phoneticTail);
	//std::cout<<tmpStr<<std::endl;
	QTextView::setText(tmpStr);
	//QTextView::setText(text);
}
void MyMultiLineEdit::viewportMouseReleaseEvent(QMouseEvent *e)
{
	QTextView::viewportMouseReleaseEvent(e);
	if(hasSelectedText()) this->copy();
	//printf("release\n");
}
void MyMultiLineEdit::keyPressEvent(QKeyEvent *e)
{
	//printf("%x\n",e->key());
	switch(e->key())
	{
		case 0x1012 :
			verticalScrollBar()->subtractPage();
			break;
		case 0x1014 :
			verticalScrollBar()->addPage();
			break;
	}
	QTextView::keyPressEvent(e);
	
}
